package com.tanhua.dubbo.api.mongo;

import com.tanhua.model.mongo.Dimensions;
import org.apache.dubbo.config.annotation.DubboService;
import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;

@DubboService
public class DimensionsApiImpl implements DimensionsApi{
    @Autowired
    private MongoTemplate mongoTemplate;
    /**
     * 根据维度id查询维度表
     *
     * @param dimensionsId
     * @return
     */
    @Override
    public Dimensions findDimensionsById(ObjectId dimensionsId) {
        return mongoTemplate.findById(dimensionsId,Dimensions.class);
    }
}
